<style>
.layui-form-pane .layui-form-label{width:auto;}
.layui-form-item{margin-bottom: 0px;}
</style>
<div class="fixed-bar">
<form class="layui-form layui-form-pane fixed-bar-form" action="{:url()}" method="get" id="hisi-table-search">
<div class="layui-form-item">
 
 <div class="layui-inline">
 	<label class="layui-form-label">关键词</label>
     <div class="layui-input-inline">
         <input type="text" name="content" lay-verify="" placeholder="输入关键词" class="layui-input">
     </div>
 </div>
 <div class="layui-inline">
 	<label class="layui-form-label">发布时间</label>
     <div class="layui-input-inline">
         <input type="text" name="release_time" id="release_time" lay-verify="" placeholder="输入发布时间" class="layui-input">
     </div>
 </div>

 <div class="layui-inline">
 	<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
 </div>
</div>
</form>
</div>

<table id="dataTable"></table>

{include file="system@block/layui" /}

<script type="text/html" id="toolbar">
    <div class="layui-btn-group fl">
        <a href="{:url('add')}" class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-circle-fine hisi-iframe" hisi-data="{width: '80%', height: '80%'}" title="发布公告">&nbsp;发布公告</a>
		
    </div>
</script>

<script type="text/html" title="操作按钮模板" id="buttonTpl">
    {{# if(d.release_status==0){ }}
	<a href="{:url('release')}?id={{ d.id }}" class="layui-btn layui-btn-xs hisi-ajax" title="发布">发布</a> 
    {{# } }}
    <a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs hisi-iframe" hisi-data="{width: '70%', height: '700px'}" title="编辑">编辑</a>
	<a href="{:url('del')}?id={{ d.id }}" class="layui-btn layui-btn-xs hisi-ajax" title="删除">删除</a>
</script>
<script type="text/html" id="useOrders">
    {{ d.use_orders_30d }} / 
	{{# if(d.use_orders > 0){ }}
		<a href="{:url('history')}?id={{ d.id }}" class="hisi-iframe blue" title="使用产品记录">{{ d.use_orders }}</a>
	{{# }else{ }}
		0
	{{# } }}
</script>
<script type="text/html" id="useTimeTpl">
    <div>{{layui.util.toDateString(d.use_time * 1000) }}</div>
</script>
<script type="text/html" title="打标日志" id="viewTpl">
		<a href="{:url('view')}?id={{ d.id }}" title="公告查看" class="hisi-iframe" hisi-data="{width: '90%', height: '90%'}">{{ d.title }}</a>
</script>
<script type="text/javascript">
    layui.use(['table', 'tool', 'laydate','jquery'], function() {
        var $=layui.jquery,table = layui.table,laydate=layui.laydate;
        laydate.render({
		    elem: '#release_time'
		    ,range: '~'
		    ,theme: 'molv'
		    ,mark: {'{:$today}':''}
	    	,change: function(value, date, endDate){
		    	$('#release_time').val(value);
            	$('#layui-laydate1').remove();//关闭面板
            }
		});
        table.render({
            elem: '#dataTable'
            ,url: '{:url()}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,limits: [20,50,100,150,200]
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: '#toolbar'
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,cols: [[ //表头
            	{type:'checkbox', fixed:'left'}
                ,{field: 'create_time', title: '发布日期',templet:function(d){return layui.util.toDateString(d.create_time * 1000)}}
                ,{field: 'title', title: '标题',templet:'#viewTpl'}
                ,{field: '', title: '操作', templet: '#buttonTpl', fixed: 'right'}
            ]]
        });
    });
</script>